package com.toppitch.site.config;

import java.util.Map;

import org.springframework.util.ClassUtils;

public class AppConfig {
	private Map<String, String> map = null;

	private String root = null;
	
	public AppConfig(){
		root = ClassUtils.getDefaultClassLoader().getResource("/").getPath().replace("%20", " ");
		if(root.lastIndexOf("/") > root.lastIndexOf("\\")){
			root = root.substring(0, root.lastIndexOf("/") + 1);
		}else{
			root = root.substring(0, root.lastIndexOf("\\") + 1);
		}
		if(root.contains(":") && root.startsWith("/")){
			root = root.substring(1);
		}
	}
	
	public Map<String, String> getMap() {
		return map;
	}

	public void setMap(Map<String, String> map) {
		this.map = map;
	}

	public String getRoot() {
		return "";//root;
	}
}
